<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="ZH-CN">
<c:choose>
  <c:when test="${student_name }==null">
    <c:redirect url="/LWGL"></c:redirect>
  </c:when>
</c:choose>
<head>
<title>论文正文提交</title>
<meta http-equiv="X-UA-Compatible" content="IE=9" >  
<meta name="keywords" content="吉珠,吉林大学,吉林大学珠海学院,吉林大学珠海学院论文管理">
<meta name="content-type" content="text/html" charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href=".//css/bootstrap.css" type="text/css">
<script src=".//js/jquery-2.1.1.js" type="text/javascript"></script>
<script src=".//js/bootstrap.js" type="text/javascript"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/jquery-easyui-1.4.1/jquery.min.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/jquery-easyui-1.4.1/themes/gray/easyui.css"
	type="text/css"></link>
<link rel="stylesheet" href="<%=request.getContextPath()%>/jquery-easyui-1.4.1/themes/icon.css"
	type="text/css"></link>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/jquery-easyui-1.4.1/locale/easyui-lang-zh_CN.js"></script>
<!-- upload                                 -->
<script type="text/javascript">
var stu_final_Dis;
	$(function() {

		stu_final_Dis = $('#stu_final_Dis').datagrid({
			url : '<%=request.getContextPath()%>/dinggaoTable',
			//data:[{}],
			 cache: false,
			fit : true,
			fitColumns : true,
			onLoadSuccess:function(data){
						if(data.rows==false){
	    var obj =document.getElementById("stutable");
         obj.innerHTML="<div class='alert alert-info' role='alert'>您还未上传文件！请在课题申报通过后自行上传论文稿的相关文件，等待教师审核！</div>";
					}
			},
			columns : [ [  {
				field : 'thesistitle_name',
				title : '论文题目',
				width : 150,
				align:'center'
			}, {
				field : 'thesistitle_type',
				title : '论文类型',
				width : 100,
				align:'center'
			}, {
				field : 'thesissource_name',
				title : '来源',
				width : 100,
				align:'center'
			}, 
			{
				field : 'ensuredraft_newmemo',
				title : '意见',
				width : 100,
				align:'center',
							formatter : function(value, row, index) {
				if(value=="A")
				return "<a onclick=showmemo("+index+")><font color='#00FF00'>有更新</font></a>>";
				if(value=="B")
			     return "<a onclick=showmemo("+index+")><font color='#FF7F00'>查看</font></a>";
			     return "<a onclick=showmemo("+index+")><font color='#FF7F00'>查看</font></a>";
			}
			},
			{
				field : 'ensuredraft_tchconfirm1',
				title : '一次查重稿确定状态',
				width : 100,
				align:'center',
							formatter : function(value, row, index) {
				if(value=="A")
				return "<font color='#FF8800'>未确认</font>";
				if(value=="B")
				{
				document.getElementById('bt').disabled=true;
				return "<font color='#FF5511'>确认</font>";
				}
			}
			},
			 {
				field : 'ensuredraft_tchconfirm2',//这里建议加多一个状态，即“无记录”状态
				title : '二次查重稿确定状态',
				width : 100,
				align:'center',
									formatter : function(value, row, index) {
				if(value=="A")
				return "<font color='#FF8800'>未确认</font>";
				if(value=="B")
				return "<font color='#FF5511'>确认</font>";
			}
			},
			 ] ]
			 

		});
		
	});
		//-意见显示-------------------------------
	function showmemo(index){
     //alert(index);
     var rows = $("#stu_final_Dis").datagrid("getRows"); 
		$.ajax({
		url : '<%=request.getContextPath()%>/StuGetMemo',
		Type : 'POST',
		data : {
			"id" : rows[index].student_id,
			"type":"B"
		},
		success : function showValue(r) {
		//alert("lalalala");
		document.getElementById("teacherComent").value=r.text;
			// traget.value="无记录";
		}
	});
		var traget_div=document.getElementById("teacherComent_div");
             traget_div.style.display="block";
    }
      function uploadFile(form) {
       var path=form.fileToUpload.value;
         if(path==""){
      alert("请选择上传文件");
          return;
      }
      var index=path.lastIndexOf(".");
      var result =path.substr(index+1);
      //alert(result);
     
      if(result!="pdf"&&result!="PDF")
      {
       //alert(result);
        alert("请上传文件格式为pdf的文件");
          return;
      }
      path=form.fileToUpload1.value;
     
     index=path.lastIndexOf(".");
     result =path.substr(index+1);
    
       if(result!="rar"&&!result==""&&result!="zip")
      {
        alert("请上传文件格式为rar或者zip的文件");
          return;
      }
      
       var traget=document.getElementById("butToprogress");
      traget.innerHTML= "<p align='center'><progress id='progressBar' value='0' max='100'></progress><span id='percentage'></span></p>";
      
        var fd = new FormData();
        fd.append("论文定稿", document.getElementById('fileToUpload').files[0]);
        fd.append("论文定稿附件", document.getElementById('fileToUpload1').files[0]);
        var xhr = new XMLHttpRequest();
        xhr.upload.addEventListener("progress", progressFunction, false);
        xhr.addEventListener("load", uploadComplete, false);
        xhr.addEventListener("error", uploadFailed, false);
        xhr.addEventListener("abort", uploadCanceled, false);
        xhr.open("POST", "<%=request.getContextPath()%>/mystuupload");
        xhr.send(fd);
      }
      
       function progressFunction(evt) {

            var progressBar = document.getElementById("progressBar");

            var percentageDiv = document.getElementById("percentage");

            if (evt.lengthComputable) {

                progressBar.max = evt.total;

                progressBar.value = evt.loaded;

                percentageDiv.innerHTML = Math.round(evt.loaded / evt.total * 100) + "%";

            }

        }  

      function uploadComplete(evt) {
        /* This event is raised when the server send back a response */
      alert(evt.target.responseText);
     
            // file.outerHTML = file.outerHTML;  
      //$.messager.alert("操作提示", "成功");
     parent.location.reload();//刷新页面
      }

      function uploadFailed(evt) {
        alert("上传失败");
      }

      function uploadCanceled(evt) {
        alert("上传已经取消");
      }
    </script>


<!-- upload                                 -->
<style>
.col-xs-3 {
	padding: 1px;
	height: 600px;

}
.col-xs-9 {
	height: 600px;
	
}
.container {
	width: 1280px !important;
}

.xs11 {
	margin-top: 10px;
	margin-left: 30px;
}
#right
{
position:absolute;
right:50px;
width:300px;
}
#X
{
position:absolute;
right:35px;
width:35px;
top:2px;
}
#xs12 {
	height: 494px;
	width: 313px;
}
#xs11 {
	height: 140px;
}
#xs2{
	width:600px;
	height:35px;
	}
#xs1 {
	height: 100px;
	width: 80px;
}
body {
	font-size: 12px;
}
ul {
	margin: 0;
	padding: 7px;
}
ul li {
	height: 22px;
	vertical-align: bottom;
}
.actived {height:25px;border-top:3px solid #ff9900;;border-right:1px solid #AAC7E9; border-left:1px solid #AAC7E9;border-bottom:1px solid #AAC7E9;background:#FFDAB9;}

.panel-group{padding:1px; margin：1px;}
</style>
<script type="text/javascript" language="javascript">
function g(o){return document.getElementById(o);}
function hoverli(n){
for(var i=1;i<=19;i++){
{g('tb_'+i).className='';}
g('tb_'+n).className='actived';}
}

function show(id){
var traget=document.getElementById(id);
traget.style.display="block"; 
}

function hide(id){
var traget=document.getElementById(id);
traget.style.display="none"; 
}
</script>



</head>

<body>
<!--全局框架 开始 conteiner-->
<div class="container"> 
  <!--标题头图片-->
  <div class="row">
    <div class="body_top"> <img src="img/head.png" align="center" width="1280px"/> </div>
  </div>
  <!--全局12栅格 规划全局区域图线 开始 row+ col-->
  <div class="row">
   <jsp:include page="stu_siderbar.jsp"></jsp:include>
        <!--全局框架结束--> 

<!--右侧用户操作模块 占全局9栅格-->
    
<div class="col-xs-9"style="border:2px solid #25465d">
      <div class="row">
            <div class="col-xs-5  xs11" style="margin-bottom:5px; margin-top:5px;"> <strong><font size="3">流程管理》论文查重（定）稿提交</font></strong> </div>
            <div class="col-xs-5 xs11" id="right" style="margin-bottom:5px; margin-top:5px;">
              <p><b><font size="3">毕业设计流转状态：&nbsp;&nbsp;&nbsp;中期阶段
              </b></font> </p></div>
          </div>
          <div class="row">
            <div class="col-xs-11  xs11" style="margin-bottom:5px; margin-top:0px;">
              <div class="panel panel-default" style="margin-bottom:5px; margin-top:0px;">
                <div class="panel-heading" align="left"> <a data-toggle="collapse" data-parent="#accordion"  href="#collapseHelp" class="glyphicon glyphicon-chevron-down"> 操作指南 </a> </div>
                <div id="collapseHelp" class="panel-collapse collapse">
                  <div class="panel-body">论文正文由两部分组成，其中设计（论文）必须上传，附件部分根据导师要求选择上传：
                    <ul>
              <li>论文正文必须按照论文模板要求，完成论文的封页、中英文摘要、目录、正文、结论、参考文献部分。</li>
              <li>论文正文是经过指导教师审核、修改、最后通过审核的论文，学生需要提交论文正稿作为论文知网查检测的论文模板。</li>
              <li>提交的论文名称：学号+学生姓名.doc</li>
                    </ul>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div id="stutable" class="col-xs-11 xs11" style="margin-bottom:5px; margin-top:0px;height:60px">
           
           <table id="stu_final_Dis"></table>
           
              </div>
              </div>
              <div class="row">
                <div class="col-xs-11 xs11">
                  <form id="form1" enctype="multipart/form-data">
                  <table class="table table-bordered" style="margin-bottom:5px; margin-top:0px;">
                    <b> <font size="3">论文正文提交</font></b>
                    <tbody>
                      <tr>
                        <td class="info" width="25%"><p align = "center"><b>
                            <label for="exampleInputFile">论文正文文件:</label>
                          </p>
                          </b>
                          </td>
                        <td width="80%"><div style="border:2px solid #25465d ; background-color:#d8d8d8;" id="xs2">
                            <div class="form-group">
                              <label class="sr-only" for="inputfile">文件输入</label>
                              <input type="file" name="fileToUpload" id="fileToUpload">
                            </div>
                          </div>
                          </td>
                      </tr>
                      <tr>
                        <td class="info" width="25%"></td>
                        <td>论文正稿要求按照标准模板撰写完成，其中包括开题报告，封面，中英文摘要，目录，正文，参考文献等。上传格式建议采用PDF格式。</td>
                      </tr>
                                            <tr>
                        <td class="info" width="25%"><p align = "center"><b>
                            <label for="exampleInputFile">(可选)论文正文附件:</label>
                          </p>
                          </b>
                          </td>
                        <td width="80%"><div style="border:2px solid #25465d ; background-color:#d8d8d8;" id="xs2" >
                            <div class="form-group">
                              <label class="sr-only" for="inputfile">文件输入</label>
                              <input type="file" name="fileToUpload1" id="fileToUpload1">
                            </div>
                          </div>
                          </td>
                      </tr>
                      <tr>
                        <td class="info" width="25%"></td>
                        <td>附指毕业设计中产生的应用程序代码、图片、音频、视频资料等材料，要求统一打包成zip，或rar等压缩文件后再上传，原则文件大小不得超过50M。</td>
                      </tr>
                    </tbody>
                  </table>
 <div id="butToprogress"><p align="center" style="margin-bottom:0px; margin-top:5px;" ><button id="bt" type="button" class="btn btn-success btn-bg" 
                     name=""  onclick="uploadFile(form1)" value="刷新"/>
                    提交</button></p></div>
                </form>
                <!-- ------------uploadform -->
      </div>
    </div>
             <!-- 后台人员代码开始 -->
         <div class="row" align="center">
                <div class="col-xs-11  xs11" style="margin-top:5px; margin-bottom:0px;">
                   <div  id="teacherComent_div" class="panel-body" style="display:none">
                   <a data-toggle="collapse" data-parent="#accordion" href="#collapseSHYJ"><img src="img/close.png" id="X" onClick="hide('teacherComent_div');"></img></a> 
                   <h4 align="left">指导教师审核意见</h4>
                         <textarea id="teacherComent" class="form-control" rows="3" readonly="readonly" >无记录</textarea>
                   </div> 
               </div> 
     </div> 
            <!--后台人员代码结束  -->
  </div>
</div>
</div>
<!--全局框架开始 conteiner-->
</div>
<div class="row" style="background-color:#25465d"">
  <p  align="center" style="color:white;background-color:#25465d"><strong>用户单位：</strong>吉林大学珠海学院&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>版权所有：</strong>吉林大学珠海学院计算机科学与技术系</p>
</div>
<!--全局框架开始 conteiner-->
</div>
</body>
</html>
